package example.controller;

import example.service.DownloadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class DownloadController {

    @Autowired
    DownloadService ds;

    //下载显示字符串
    @RequestMapping("downloadstring")
    public String downloadstring(String firstKey){
        ds.downloadstring(firstKey);
        return "#";
    }

    //下载文件到src/result
    @RequestMapping("downloadfile")
    public String downloadfile(String fileKey){
        ds.downloadfile(fileKey);
        return "#";
    }

    //多线程下载文件到src/result
    @RequestMapping("downloadthread")
    public String downloadthread(String fileKey) throws Throwable {
        ds.downloadthread(fileKey);
        return "#";
    }


}
